quartz: Move initialization code to display_class_init
authorBenjamin Otte <otte@redhat.com>
Thu, 2 May 2013 13:43:09 +0000 (15:43 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 2 May 2013 13:43:35 +0000 (15:43 +0200)
This follows the same reasoning as the X11 backend in commit
0122a9da8eab518652553aa4e777d5caf18a6163

gdk/quartz/gdkdisplay-quartz.c
gdk/quartz/gdkdisplaymanager-quartz.c

index 17458fc3f5c86e8a0379a7a29856835fc5fd85ac..3c1a02236d1a7978a12f39669572fdf977dd2d96 100644 (file)
@@ -336,4 +336,17 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class)
   display_class->convert_selection = _gdk_quartz_display_convert_selection;
   display_class->text_property_to_utf8_list = _gdk_quartz_display_text_property_to_utf8_list;
   display_class->utf8_to_string_target = _gdk_quartz_display_utf8_to_string_target;
+
+  ProcessSerialNumber psn = { 0, kCurrentProcess };
+  void (*_gtk_quartz_framework_init_ptr) (void);
+
+  /* Make the current process a foreground application, i.e. an app
+   * with a user interface, in case we're not running from a .app bundle
+   */
+  TransformProcessType (&psn, kProcessTransformToForegroundApplication);
+
+  /* Initialize GTK+ framework if there is one. */
+  _gtk_quartz_framework_init_ptr = dlsym (RTLD_DEFAULT, "_gtk_quartz_framework_init");
+  if (_gtk_quartz_framework_init_ptr)
+    _gtk_quartz_framework_init_ptr ();
 }
index d8ba138d97fd22af155c66876fe6e12defb0d063..0b772db0b645981984305ac5381f7d8df45913ef 100644 (file)
@@ -43,18 +43,6 @@ G_DEFINE_TYPE (GdkQuartzDisplayManager, gdk_quartz_display_manager, GDK_TYPE_DIS
 static void
 gdk_quartz_display_manager_init (GdkQuartzDisplayManager *manager)
 {
-  ProcessSerialNumber psn = { 0, kCurrentProcess };
-  void (*_gtk_quartz_framework_init_ptr) (void);
-
-  /* Make the current process a foreground application, i.e. an app
-   * with a user interface, in case we're not running from a .app bundle
-   */
-  TransformProcessType (&psn, kProcessTransformToForegroundApplication);
-
-  /* Initialize GTK+ framework if there is one. */
-  _gtk_quartz_framework_init_ptr = dlsym (RTLD_DEFAULT, "_gtk_quartz_framework_init");
-  if (_gtk_quartz_framework_init_ptr)
-    _gtk_quartz_framework_init_ptr ();
 }
 
 static void